#include "GameStartNetworkEvent.h"
#include "ClientMenuState.h"
#include "LobbyState.h"

GameStartNetworkEvent::GameStartNetworkEvent(unsigned int widthOfWell)
{
    message.header.code = NetworkEvent::SERVER_GAME_START;
    message.header.sizeOfData = sizeof(message.data);
    message.data.widthOfWell = widthOfWell;
}

GameStartNetworkEvent::GameStartNetworkEvent(const Header& header, const Data& data)
{
    message.header = header;
    message.data = data;

}

GameStartNetworkEvent::~GameStartNetworkEvent()
{
}

void* GameStartNetworkEvent::getMessageBlob()
{
    return &message;
}

size_t GameStartNetworkEvent::getMessageBlobSize()
{
    return sizeof(message);
}

GameState* GameStartNetworkEvent::visitClientMenuState(ClientMenuState* clientMenuState) const
{
    return clientMenuState->handleServerGameStartEvent(message.data.widthOfWell);
}

GameState* GameStartNetworkEvent::visitLobbyState(LobbyState* lobbyState) const
{
    return lobbyState->handleServerGameStartEvent(message.data.widthOfWell);
}
